package com.example.lock;

import java.util.concurrent.TimeUnit;

public interface DistributedLock {


    /**获取锁
     * @param lockName
     * @param acquireTime
     * @param expireTime  */
    String  acquireLock(String lockName, Long acquireTime, Long expireTime) throws Exception;

    /**带超时时间的获取锁
     * @return*/
    String acquireLock(String lockName, Long time, TimeUnit unit) throws Exception;

    /**释放锁
     * @param lockName
     * @param identify */
    void  release(String lockName, String identify) throws Exception;

    /**
     * 锁续期
     * */
    Boolean extendLockTime(String lockName, Long time, String identify);
}
